package com.somekim.samenum;

/**
 * @author zdl
 * @version v1.0
 * @date 2019/8/28
 */
public class MyThread extends Thread{
    private int i = 5;

    @Override
    public void run() {
        System.out.println("i=" + (i--)
                + " threadName=" + Thread.currentThread().getName());
        /**
         * 注意：代码i--由前面项目中单独一行运行改成在当前项目中在println()方法中
         * 直接进行打印
         */
    }

    public static void main(String[] args) {
        MyThread run = new MyThread();
        Thread t1 = new Thread(run);
        Thread t2 = new Thread(run);
        Thread t3 = new Thread(run);
        Thread t4 = new Thread(run);
        Thread t5 = new Thread(run);
        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
    }
}
